﻿using System;
using System.Collections.Generic;
using System.Text;
using AutoUpdate.Models;
using Microsoft.EntityFrameworkCore;

namespace AutoUpdate.DAL
{
    public class ContextFactory
    {
        public static DbContext Create()
        {
            DbContext dbContext = CallContext.GetData("dbContext") as DbContext;
            if (dbContext == null)
            {
                dbContext = new AutoUpdateDBContext();
                CallContext.SetData("dbContext", dbContext);
            }

            return dbContext;
        }
    }
}
